package de.tabuma.pm.projectnavigation.view;

import de.tabuma.lib.tabumaview;
import de.tabuma.pm.*;
import java.io.PrintWriter;
import java.util.*;
import java.util.logging.*;
import javax.servlet.*;
import javax.servlet.http.*;

/**
 *
 * @author alefen
 */
public class create extends tabumaview {

    public create(String servlet, Hashtable parameter) {
        super(servlet, parameter);
    }

    @Override
    public void processRequest(ServletContext context, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {


        if(request.getAttribute(constants.ProjectNavigationAdd)!=null) {
            String pnName = "Add Navigation Name";

            String link1 = "";
            Enumeration enu = this.getParameter().keys();
            while(enu.hasMoreElements()) {
                String key = (String) enu.nextElement();
                String value = (String) this.getParameter().get(key);
                link1 += "<input type=\"hidden\" name=\""+key+"\" value=\""+value+"\"/>";
            }

            out.println("<form action=\""+this.getServlet()+"#"+constants.ProjectNavigationA+"\">");
            out.println(link1 + pnName +"<input type=\"text\" name=\""+constants.ProjectNavigationName+"\"/> <input type=\"hidden\" name=\""+constants.ProjectNavigationAdd1+"\" value=\"true\"/> <input type=\"hidden\" name=\""+constants.ProjectNavigationId+"\" value=\""+request.getAttribute(constants.ProjectNavigationId)+"\"/> <input type=\"submit\" name=\"add\" class=\"smallbutton\" value=\"Add\"/>");
            out.println("</form>");
        }

    }

}
